<template>
  <div>
    <div class="mui-numbox" data-numbox-min='1' style="height: 25px;">
      <!-- "-"按钮，点击可减小当前数值 -->
      <button class="mui-btn mui-numbox-btn-minus" type="button">-</button>
      <input class="mui-numbox-input" type="number" :value="count" ref="num" readonly @change="changenum"/>
      <!-- "+"按钮，点击可增大当前数值 -->
      <button class="mui-btn mui-numbox-btn-plus" type="button">+</button>   
    </div>
  </div>
</template>
<script>
import mui from "../../../node_modules/mui/js/mui.js";
export default {
  data() {
    return {};
  },
  props: ['count','id'],
  methods: {
    changenum() {
      this.$store.commit('updateCount', [this.id, this.$refs.num.value])
    }
  },
  mounted() {
    mui(".mui-numbox").numbox();
  }
};
</script>
<style lang="css" scoped>

</style>